cmake_minimum_required(VERSION 3.0.2)
project(cln_msgs)

## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs nav_msgs geometry_msgs message_generation)

## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)


## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()

################################################
## Declare ROS messages, services and actions ##
################################################

## To declare and build messages, services or actions from within this
## package, follow these steps:
## * Let MSG_DEP_SET be the set of packages whose message types you use in
##   your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
## * In the file package.xml:
##   * add a build_depend tag for "message_generation"
##   * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET
##   * If MSG_DEP_SET isn't empty the following dependency has been pulled in
##     but can be declared for certainty nonetheless:
##     * add a exec_depend tag for "message_runtime"
## * In this file (CMakeLists.txt):
##   * add "message_generation" and every package in MSG_DEP_SET to
##     find_package(catkin REQUIRED COMPONENTS ...)
##   * add "message_runtime" and every package in MSG_DEP_SET to
##     catkin_package(CATKIN_DEPENDS ...)
##   * uncomment the add_*_files sections below as needed
##     and list every .msg/.srv/.action file to be processed
##   * uncomment the generate_messages entry below
##   * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)

## Generate messages in the 'msg' folder
add_message_files(
  FILES
  MapStatus.msg
  VoiceOutput.msg
  NetworkState.msg
  TimerTask.msg
  CleanTaskQueue.msg
  CanRxMsg.msg
  BasicState.msg
  TaskMeta.msg
  CleanTask.msg
  MarkerPointMsg.msg
  VirtualDataMsg.msg
  FunctionalAreaData.msg # 功能区域20231207-dw.liu
  MapInfoMsg.msg
  LogMsg.msg
  RegionIdMap.msg   #ccpp
  Recharge.msg
  NightModeCtrl.msg # 夜间模式控制
  CleanDevice.msg
  CleanDeviceState.msg
  CleanDeviceType.msg
  Sensor.msg
  SensorState.msg
  SensorType.msg
  HardwareState.msg
  HardwareStateType.msg
  HardwareCtrl.msg      #
  RobotSn.msg     #ipc_manager
  IpcState.msg   #ipc_manager
  ElevatorState.msg  #电梯控制
  CleanDeviceMode.msg #hardware_abstract_layer
  UpdateState.msg
  ElevatorPoseMsg.msg
  AlarmMsg.msg  #alarm_manager
  TaskRecod.msg
  StringArray.msg
  Dock2D.msg
  LogUploadState.msg 
  LogUploadStateArray.msg
  LidarScan2dCalibration.msg    # 雷达扫描标定版信息，下个版本屏蔽 
  CameraCalibrationStatus.msg    # 相机标定状态，下个版本屏蔽 
  MapSyncState.msg      # 地图同步 上传、下载 状态
  IMUCalibrationStatus.msg  #IMU校准状态，下个版本屏蔽 
  CalibrationStatus.msg     #传感器校准状态
  AlarmMsgArray.msg         #报警列表
  CartoCpuMem.msg         #cartographer cpu/mem占用率
  SoftwareVersionHistory.msg # 软件版本历史信息
  MotorEncoder.msg        #编码器数据
  CodeInfo.msg            #二维码信息
  CodeInfoArray.msg       #二维码信息列表
  ElevatorTimerTask.msg   #梯控定时任务
  ElevatorTimerTaskArray.msg   #梯控定时任务列表
  MapIndex.msg
  DockerPoints.msg   #梯控充电桩和默认标记点
  PeripheralState.msg
  TaskError.msg
  BagStatus.msg # bag状态 20230914-dw.liu
  MotionReport.msg # 运动停滞报告 20230918-tp.chen
  AutoGateMsg.msg  #门禁/闸机标记  20230918-tp.chen
  DisinFectLiquid.msg
  AxAction.msg 
  AxSlamState.msg
  BoolArray.msg
  AxLaserScan.msg
  Barcode.msg   #反光板定位 20240320-dl.an
  Maintenance.msg # 维护保养时间 20240419-dw.liu
  MotorState.msg
  Machine_state.msg
  DynCtrlDebug.msg
  DynCtrlWrokingProcess.msg
  DynCtrlFollowPath.msg
  AxAlert.msg
  AxAlerts.msg
  DiagnoseFaults.msg
)

## Generate services in the 'srv' folder
add_service_files(
  FILES
  MapName.srv
  MapList.srv
  AskPathList.srv
  AskMapImg.srv
  DiskTaskList.srv
  AskMapList.srv
  LoadMap.srv
  PackTask.srv
  TaskQueueAdjust.srv
  P2PGen.srv
  CanTxSrv.srv
  DBTaskExec.srv
  TaskQuery.srv
  GenerateTeachPath.srv
  MarkerPoint.srv
  MarkerPointDel.srv
  MarkerPointCmd.srv
  VirtualData.srv
  MapSearch.srv
  LogQuery.srv
  TimertaskSwitch.srv
  SetAddLines.srv         #ccpp
  SetAddGrid.srv          #ccpp
  GetWorkRgnGrid.srv      #ccpp
  MakeCoveragePlan.srv    #ccpp
  GetWorkMap.srv            #ccpp
  GetWorkMapInfo.srv        #ccpp
  EstimDistanceOnMap.srv    #ccpp
  CoverPathGen.srv
  GenerateRobotSN.srv       #序列号
  UpdateRobotSN.srv         # 更新序列号相关信息（产品类型）
  SetValue.srv
  UpdateCheck.srv
  ElevatorPose.srv  #电梯位置
  ElevatorRobotCtrl.srv  #机器人控制电梯
  ElevatorHttpFloor.srv #向梯控平台请求转移楼层
  ElevatorHttpCtrl.srv #向梯控平台请求完成或取消
  ElevatorTransFloor.srv #添加梯控任务
  ElevatorPoseAdd.srv
  ElevatorPoseDel.srv
  ElevatorPoseQry.srv
  ElevatorPoseUpd.srv
  AllSparsePath.srv #稀疏路径
  TaskRecordQuery.srv
  FirmwareUpgrade.srv  # 硬件端：固件更新服务，反馈烧写状态
  Stm32WriteFlash.srv     #向32单片机写入急停类型
  GenerateHandPoly.srv # 手动推机器人生成polygon
  BagQuery.srv  #bag查询
  HaltCtrl.srv  #停机模式
  Lidar2dCalibration.srv
  MapSync.srv # 地图同步 上传
  CameraCalibration.srv    # 相机标定服务
  SoftwareVersionList.srv  # 软件版本历史列表
  ElevatorTimerTaskManager.srv   #梯控定时任务管理
  AllDockers.srv   #查询所有的充电桩
  TimeZone.srv
  ElevatorFinishCloseDoor.srv  #进出梯是否成功
  ElevatorYunjiLoraCommunication.srv #请求云迹lora设备控制电梯
  ElevatorYunjiLoraState.srv #通过lora通讯获取电梯状态
  BagRecord.srv # 录制bag服务 20230914-dw.liu
  AutoGate.srv # 门禁/闸机服务
  YunjiAccessControl.srv #云迹门禁服务
  GenAutoGatePath.srv  #生成门禁/闸机路径
  AxGlobalPositioning.srv 
  AxSetPose.srv
  FunctionalArea.srv # 功能区域20231207-dw.liu
  HubCtrl.srv #hub端口控制服务 20240103-ls.wen
  TaskState.srv#任务状态 20240306-y.huang
  RequestTaskPathPicture.srv # 任务路径图片20240307-dw.liu
  BarcodeDel.srv    #反光板信息删除 20240320-dl.an
  BarcodeSave.srv   #反光板信息保存 20240320-dl.an
  BarcodeList.srv   #反光板信息列表 20240320-dl.an
  BarcodeManager.srv  #反光板aoting服务
  RequestMaintenance.srv # 维护保养时间 20240419-dw.liu
  GetBool.srv
)

## Generate actions in the 'action' folder
# add_action_files(
#   FILES
#   Action1.action
#   Action2.action
# )

## Generate added messages and services with any dependencies listed here
generate_messages(
  DEPENDENCIES
  std_msgs
  nav_msgs
)

################################################
## Declare ROS dynamic reconfigure parameters ##
################################################

## To declare and build dynamic reconfigure parameters within this
## package, follow these steps:
## * In the file package.xml:
##   * add a build_depend and a exec_depend tag for "dynamic_reconfigure"
## * In this file (CMakeLists.txt):
##   * add "dynamic_reconfigure" to
##     find_package(catkin REQUIRED COMPONENTS ...)
##   * uncomment the "generate_dynamic_reconfigure_options" section below
##     and list every .cfg file to be processed

## Generate dynamic reconfigure parameters in the 'cfg' folder
# generate_dynamic_reconfigure_options(
#   cfg/DynReconf1.cfg
#   cfg/DynReconf2.cfg
# )

###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if your package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES cln_msgs
 CATKIN_DEPENDS roscpp rospy std_msgs message_runtime
#  DEPENDS system_lib
)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
# include
  ${catkin_INCLUDE_DIRS}
)

## Declare a C++ library
# add_library(${PROJECT_NAME}
#   src/${PROJECT_NAME}/cln_msgs.cpp
# )

## Add cmake target dependencies of the library
## as an example, code may need to be generated before libraries
## either from message generation or dynamic reconfigure
# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

## Declare a C++ executable
## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide
# add_executable(${PROJECT_NAME}_node src/cln_msgs_node.cpp)

## Rename C++ executable without prefix
## The above recommended prefix causes long target names, the following renames the
## target back to the shorter version for ease of user use
## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")

## Add cmake target dependencies of the executable
## same as for the library above
# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

## Specify libraries to link a library or executable target against
# target_link_libraries(${PROJECT_NAME}_node
#   ${catkin_LIBRARIES}
# )

#############
## Install ##
#############

# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html

## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# catkin_install_python(PROGRAMS
#   scripts/my_python_script
#   DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark executables for installation
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html
# install(TARGETS ${PROJECT_NAME}_node
#   RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark libraries for installation
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_libraries.html
# install(TARGETS ${PROJECT_NAME}
#   ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
#   LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
#   RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
# )

## Mark cpp header files for installation
# install(DIRECTORY include/${PROJECT_NAME}/
#   DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
#   FILES_MATCHING PATTERN "*.h"
#   PATTERN ".svn" EXCLUDE
# )

## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
#   # myfile1
#   # myfile2
#   DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )

#############
## Testing ##
#############

## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_cln_msgs.cpp)
# if(TARGET ${PROJECT_NAME}-test)
#   target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()

## Add folders to be run by python nosetests
# catkin_add_nosetests(test)
